﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="description" content="{$cfg_site_description}" />

<title>過往團購 {$cfg_site_name} - {$cfg_site_description}</title>
{template 'header'}
<body>
<div id="buy917_wrap">  
    <div id="buy917_header">
    	<div id="buy917_logo"><a href="index.php">Buy917</a></div>
        <div class="buy917_header_banner">
        	<div class="buy917_header_topbanner">
				{template 'login_line'} <!-- login_line.html 登入/註冊按鈕 --> 
				<?php include("admin/event.php")?>
            </div>
          	<div class="buy917_header_select">
            	<div class="buy917_header_city">
                	 {if !empty($_cityid)}
                    <div class="guides">
                        <div class="city">
                            <h2>{$_cityname}</h2>
                        </div>
                        <div id="guides-city-change" class="change">切換城市</div>
                        <div id="guides-city-list" class="city-list">
                            <ul>
                            {loop $_citylist $v}
                                <li {if $v['cid']==$_cityid}class="current"{/if}><a href="index.php?cityid={$v['cid']}">{$v['cityname']}</a></li>
                            {/loop}
                            </ul>                   
                        </div>
                    </div>
                    {/if}	
                </div>
                <div class="buy917_header_group">
                	{template 'headergroup'}	
                </div>
            </div>
       </div>
    </div><!-- buy917_header -->
  
   	{template 'menu_nav'} <!-- menu 導覽頁 --> 
       
    <div id="buy917_middle">
        	<div class="buy917_grouplist_top"></div>      
            <div class="buy917_grouplist_body"> 
                <h2>過往團購</h2>
        		<div class="g_recent">
                      <ul>
                      		{php $tmp = "";}
							{loop $dataarray $n $r}
                            {php if ($tmp==$r['title'] || $r['filepath']=="") continue;}
                            {php $r['group_buynum']=$r['group_buynum']+$r['group_startnum'];}
                            {php $r['group_usernum']=$r['group_usernum']+$r['group_startnum'];}
                        <li>
						{if $timestamp<$r['group_end_time'] && $r['stock']>$r['group_buynum']}
                        <div class="ing"></div>
						{elseif $r['stock']<=$r['group_buynum']}
						<div class="saleout"></div>
						{elseif $timestamp>=$r['group_end_time'] && $r['group_usernum']<=$r['group_buynum']}
						<div class="pass"></div>
						{else}
						
						<!-- 團購失敗 -->
						 {/if}
                        <div class="img">
                             <a href="view.php?gid={$r['gid']}"><img src="{$r['filepath']}" border="0"></a>
                             <div class="d_y" style="width:75px; float:left;">{date(" Y-m-d", $r['group_begin_time'])}</div>
							  {php $w=array("星期日","星期一","星期二","星期三","星期四","星期五","星期六");}
							 <div class="d_r">{echo $w[date('w',$r['group_begin_time'])]}&nbsp;&nbsp;&nbsp;&nbsp;</div>
                        </div>
                                                 
                         <div class="grouplist_right">
                          <div class="tit" style="height:45px; overflow:hidden;"><a href="view.php?gid={$r['gid']}">{$r['title']}</a></div>                               
                              <div class="info">
								<div style="margin-left:2px; margin-top:5px; width:100px; height:65px; border:solid 1px #98c267; background:#e7f5d9; float:left; text-align:center; padding-top:10px; "><b style="font-size:26px;">{$r['total_buynum']}</b><br>人購買</div>
								<div style="margin-left:10px; margin-top:5px; width:120px; height:75px; border:solid 1px #7accf6; background:#cfeef6; float:left;">
									<div style="height:25px; width:100%; text-align:center; color:#111;">原價：${$r['market_price']}</div>
									<div style="height:25px; width:100%; background:#e6086d; text-align:center; color:#111;">現價：${$r['shop_price']}</div>
									<div style="height:25px; width:100%; text-align:center; color:#111;">節省：${echo $r['market_price']-$r['shop_price'];}</div>
								</div>
                                <div class="jiesheng" style="clear:both;">本團共為用戶節省<span class="red">${php $a=$r['market_price']-$r['shop_price']; echo $a*$r['group_buynum']}</span></div>
                                <div class="miaoshu">{$value['goods_brief']}</div>
                              </div>
                              <div class="c"></div>
                          </div>
                          
                       </li>
                       {php $tmp=$r['title'];}
                     {/loop}
                 </ul>
			</div>
       
       	 <div class="sect">
			<div class="clear"></div>
                <div style="text-align: right; padding: 20px 0pt 0pt;">
                    <ul class="paginator">
                      {echo pagelist($total,$pagesize,$page,"grouplist.php?gid=$gid");}
                    </ul>
                </div>
			</div>

        
            </div><!-- buy productinfo -->
            <div class="buy917_grouplist_bottom"></div>
    </div><!-- buy917_middle -->
</div><!-- buy917wrap -->
<!-- footer -->
<div id="buy917_footer">
	{template 'footer'}	
</div>
</body>
</html>
